namespace 后端服务.Models
{
    /// <summary>
    /// 刷新令牌实体模型
    /// </summary>
    public class RefreshToken
    {
        /// <summary>
        /// 刷新令牌ID，主键
        /// </summary>
        public int TokenId { get; set; }

        /// <summary>
        /// 关联的用户ID，外键
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 刷新令牌字符串
        /// </summary>
        public string Token { get; set; }

        /// <summary>
        /// 刷新令牌过期时间
        /// </summary>
        public DateTime Expires { get; set; }

        /// <summary>
        /// 刷新令牌创建时间
        /// </summary>
        public DateTime CreatedDate { get; set; }

        /// <summary>
        /// 关联的用户对象，用于实体框架的导航属性
        /// </summary>
        public User User { get; set; }

        /// <summary>
        /// 设备信息（用户代理、IP地址等）
        /// </summary>
        public string DeviceInfo { get; set; }

        /// <summary>
        /// 令牌使用次数
        /// </summary>
        public int UseCount { get; set; }
    }
}